Skip to content

Feature/issue 2 additive resume - #4

Open
piscoTech wants to merge 10 commits into
feat/strands-native-interruptsfrom
feature/issue-2-additive-resume
Open

Feature/issue 2 additive resume#4
piscoTech wants to merge 10 commits into
feat/strands-native-interruptsfrom
feature/issue-2-additive-resume

Conversation

@piscoTech

@piscoTech piscoTech commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Python Preview Packages — Publish Failed

Preview publish failed for commit 4ad5bb7.
See the workflow run for details.

@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@ag-ui/a2a-middleware

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/a2a-middleware@4

@ag-ui/a2ui-middleware

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/a2ui-middleware@4

@ag-ui/event-throttle-middleware

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/event-throttle-middleware@4

@ag-ui/mcp-apps-middleware

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/mcp-apps-middleware@4

@ag-ui/mcp-middleware

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/mcp-middleware@4

@ag-ui/adk

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/adk@4

@ag-ui/ag2

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/ag2@4

@ag-ui/a2a

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/a2a@4

@ag-ui/agno

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/agno@4

@ag-ui/aws-strands

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/aws-strands@4

@ag-ui/claude-agent-sdk

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/claude-agent-sdk@4

@ag-ui/claude-managed-agents

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/claude-managed-agents@4

@ag-ui/crewai

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/crewai@4

@ag-ui/langchain

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/langchain@4

@ag-ui/langgraph

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/langgraph@4

@ag-ui/llamaindex

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/llamaindex@4

@ag-ui/mastra

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/mastra@4

@ag-ui/pydantic-ai

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/pydantic-ai@4

@ag-ui/vercel-ai-sdk

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/vercel-ai-sdk@4

@ag-ui/watsonx

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/watsonx@4

@ag-ui/a2ui-toolkit

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/a2ui-toolkit@4

create-ag-ui-app

pnpm add https://pkg.pr.new/ciolo/ag-ui/create-ag-ui-app@4

@ag-ui/client

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/client@4

@ag-ui/core

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/core@4

@ag-ui/encoder

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/encoder@4

@ag-ui/proto

pnpm add https://pkg.pr.new/ciolo/ag-ui/@ag-ui/proto@4

commit: 8a64676

@piscoTech
piscoTech marked this pull request as ready for review August 6, 2026 12:59
@piscoTech
piscoTech requested a review from fradefe August 6, 2026 12:59
piscoTech pushed a commit that referenced this pull request Aug 10, 2026
…nd hand-off

Rebuilt cleanly on top of ag-ui-protocol#2334 (which landed the halt-path fixes #1/#2).
This change carries only the two independent pieces:

Fix #4 — _normalize_tool_turns (called at the end of _build_strands_history):
- iterative merge (no RecursionError on large histories, ~1000+ tool turns)
- de-duplicate toolUseIds so a repeated id never emits a duplicate toolResult
  (Bedrock rejects that)
- preserve messages that legitimately follow a completed toolUse/toolResult
  pair in place; only drop messages wedged between the turn and its results

Fix #3 — defer frontend hand-off:
- buffer a frontend tool's ToolCallEnd instead of emitting it immediately
- flush the buffer after the turn's backend TOOL_CALL_RESULT(s), so the wire
  order is backend result -> frontend end and the client only starts the
  frontend tool once backend work has reached it
- safety flush at end of stream for turns with only frontend tool calls, so a
  buffered end is never lost (no TOOL_CALL_START left without a matching END)

Adds regression tests: normalize recursion/dedup/follow-ordering and the
deferred-end flush order. Full aws-strands suite green.

Signed-off-by: YiyuanMiao <miaoyiyuan31@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant